package cn.hd.service.impl;

import cn.hd.dao.AuthAdvertiseDao;
import cn.hd.entity.AuthAdvertise;
import cn.hd.service.AuthAdvertiseService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class AuthAdvertiseServiceImpl implements AuthAdvertiseService {
    @Autowired
    private AuthAdvertiseDao authAdvertiseDao;

    @Override
    public PageInfo<AuthAdvertise> selectAllFenYeAuthAdvertise(Map map, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<AuthAdvertise> authAdvertises = authAdvertiseDao.selectAllAuthAdvertise(map);
        PageInfo<AuthAdvertise> pageInfo=new PageInfo<>(authAdvertises);
        return pageInfo;
    }

    @Override
    public AuthAdvertise selectAuthAdvertiseById(long sadid) {
        AuthAdvertise authAdvertise = authAdvertiseDao.selectAuthAdvertiseById(sadid);
        return authAdvertise;
    }

    @Override
    public int updateAuthAdvertiseStatusPass(long sadid) {
        int i = authAdvertiseDao.updateAuthAdvertiseStatusPass(sadid);
        return i;
    }

    @Override
    public int updateAuthAdvertiseStatusFail(long sadid) {
        int i = authAdvertiseDao.updateAuthAdvertiseStatusFail(sadid);
        return i;
    }


}
